//
//  WBNetworkManager+Extension.swift
//  新浪微博
//
//  Created by shanlin on 2017/8/28.
//  Copyright © 2017年 shanlin. All rights reserved.
//

import Foundation

//MARK - :封装新浪微博的数据请求方法
extension WBNetworkManager {
    
    
    
    func statusList(since_id: Int64, max_id:Int64, compeletion: @escaping (_ list:[[String:AnyObject]]?, _ isSuccess:Bool)->()) {
        let urlString = "https://api.weibo.com/2/statuses/home_timeline.json"
        let params = ["since_id":since_id, "max_id":(max_id > 0 ?max_id - 1:0)]
        
        tokenRequest(URLString: urlString, parameters: params as [String : AnyObject]) { (json, isSuccess) in
            print(json)
            let result =  json?["statuses"] as? [[String:AnyObject]]
            compeletion(result, isSuccess)
        }
    }
}
